#include "menu.h"

//3、删除指定联系人信息
void deletePerson(Addressbooks * abs){
	cout << "请输入您要删除的联系人" << endl;
	string name;
	cin >> name;

	int ret = isExist(abs, name);
	if (ret != -1){
		for (int i = ret; i < abs->m_Size; i++){
			abs->personArray[i] = abs->personArray[i + 1];
		}
        abs->m_Size--;
		cout << "删除成功" << endl;
	}else{
		cout << "查无此人" << endl;
	}

	cout << "是否继续删除(y/n):" << endl;
	string readd;
	cin >> readd;
	if(readd == "y"){
		deletePerson(abs);
	}
	system("cls");
}